function auto(ic)

  X_GRID_SIZE = 32;
  Z_GRID_SIZE = 32;
  factor = 1;
  L = 100; % defined for n=1, scale=1
  TIME_FINAL = 2500;
  TIME_STEPS = 5000;
  fm = 3;
  amp = [0.05]; % amplitude
  temp = [1 10];


  evalpoints = [5:5:2495];
  metricorder = [0 1 2];


  totsize = length(fm)*length(amp)*length(temp)*length(metricorder)*X_GRID_SIZE*X_GRID_SIZE*length(evalpoints)*4*64/8/1024/1024;
  disp(sprintf('%.2fMB', totsize));

  cont = true;
  % keyboard()

  if cont == false
    return
  end


  etrh  = zeros(length(fm), length(amp), length(temp), length(metricorder), length(evalpoints), X_GRID_SIZE, X_GRID_SIZE);
  detrb = zeros(length(fm), length(amp), length(temp), length(metricorder), length(evalpoints), X_GRID_SIZE, X_GRID_SIZE);
  etri  = zeros(length(fm), length(amp), length(temp), length(metricorder), length(evalpoints), X_GRID_SIZE, X_GRID_SIZE);
  etr2i = zeros(length(fm), length(amp), length(temp), length(metricorder), length(evalpoints), X_GRID_SIZE, X_GRID_SIZE);

  for fmi=1:length(fm)
    for ampi=1:length(amp)
      for ti=1:length(temp)
      disp(sprintf('*** freq: %d,  amp: %d,  temp: %d', fm(fmi), amp(ampi), temp(ti)));
      [retrh, rdetrb, retri, retr2i] = h2(X_GRID_SIZE, L, Z_GRID_SIZE, TIME_FINAL, TIME_STEPS, amp(ampi), fm(fmi), evalpoints, metricorder, ic, temp(ti));
      etrh  (fmi, ampi, ti, :, :, :, :, :) = retrh;
      detrb (fmi, ampi, ti, :, :, :, :, :) = rdetrb;
      etri  (fmi, ampi, ti, :, :, :, :, :) = retri;
      etr2i (fmi, ampi, ti, :, :, :, :, :) = retr2i;
    end
  end

  save(sprintf('auto-%s.mat', datestr(clock, 'yy-mm-dd HHMM')), 'etrh', 'detrb', 'etri', 'etr2i', 'fm', 'amp', 'temp', '-v7.3');





end
